Skip to content

Add mass fraction multi-phase table to sesame2spiner#600

Merged
Yurlungur merged 42 commits intomainfrom
dempsey/mass_frac
Mar 4, 2026
Merged

Add mass fraction multi-phase table to sesame2spiner#600
Yurlungur merged 42 commits intomainfrom
dempsey/mass_frac

Conversation

@adamdempsey90
Copy link
Collaborator

@adamdempsey90 adamdempsey90 commented Jan 12, 2026

PR Summary

This adds the mass fraction SESAME table to the spiner tables that sesame2spiner outputs (if it exists). Tested in a downstream code.

Putting this up now for an initial review.

I still need to add the mass fractions to the spiner EOS class. Are we okay with adding new MassFractionFromDensityTemperature functions to all EOS classes?

Still TODO:

  • Add this field to the spiner EOS
  • Some sort of test

PR Checklist

  • Adds a test for any bugs fixed. Adds tests for new features.
  • Format your changes by using the make format command after configuring with cmake.
  • Document any new features, update documentation for changes made.
  • Make sure the copyright notice on any files you modified is up to date.
  • After creating a pull request, note it in the CHANGELOG.md file.
  • LANL employees: make sure tests pass both on the github CI and on the Darwin CI

If preparing for a new release, in addition please check the following:

  • Update the version in cmake.
  • Move the changes in the CHANGELOG.md file under a new header for the new release, and reset the categories.
  • Maintainers: ensure spackages are up to date:
    • LANL-internal team, update XCAP spackages
    • Current maintainer of upstream spackages, submit MR to spack

@adamdempsey90 adamdempsey90 self-assigned this Jan 12, 2026
@adamdempsey90 adamdempsey90 marked this pull request as draft January 12, 2026 20:41
Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Glad it was a simple change. Regarding adding mass fractions to every EOS class... Broadly I'd be supportive of this, if we had an error message/stub in the base class as the default behavior. Clearly mass fractions aren't sensible for all EOS's but they are for enough EOS's we might want this.

@adamdempsey90
Copy link
Collaborator Author

Nice! Glad it was a simple change. Regarding adding mass fractions to every EOS class... Broadly I'd be supportive of this, if we had an error message/stub in the base class as the default behavior. Clearly mass fractions aren't sensible for all EOS's but they are for enough EOS's we might want this.

It looks like the StellarCollapse EOS already has MassFractionsFromDensityTemperature

@Yurlungur
Copy link
Collaborator

Nice! Glad it was a simple change. Regarding adding mass fractions to every EOS class... Broadly I'd be supportive of this, if we had an error message/stub in the base class as the default behavior. Clearly mass fractions aren't sensible for all EOS's but they are for enough EOS's we might want this.

It looks like the StellarCollapse EOS already has MassFractionsFromDensityTemperature

I believe Helmholtz does too... or if it doesn't, it could be exposed.

…ssFraction and fill the string rather than the other way around
@adamdempsey90
Copy link
Collaborator Author

Updated to include the mass fraction query in the spiner EOS object. The unit test I added passes on my CPU machine, but not sure about the GPU machines (mostly the EOSPAC paths...)

@adamdempsey90 adamdempsey90 marked this pull request as ready for review February 24, 2026 21:53
@Yurlungur
Copy link
Collaborator

Would you like me to do review now? I could also maybe get eospac paths working through the CI?

@adamdempsey90
Copy link
Collaborator Author

Would you like me to do review now? I could also maybe get eospac paths working through the CI?

yes please.

Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamdempsey90 sorry for the delay. Some comments below. Did you want to mess with the paths yourself or did you want me to look at that? I'm happy to poke at it. Should have some time to do so tomorrow.

source ${BUILD_ENV}
pushd ${BUILD_DIR}
if [[ -f ./sesame2spiner/sesame2spiner ]]; then
echo "/usr/projects/data/eos/eos-developmental/Sn2162/v01/sn2162-v01.bin" > sesameFilesDir.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this actually probably is sufficient to getting the paths to work on device.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the gpu tests are working. Although this path shouldn't be correct for LLNL, so I don't know about that

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. We may need a general solution for that. Probably the same problem will show up for the KPT tests. My suggestion is that we set these paths as environment variables in re-git then they can be automatically slurped up here. But before we go down that path... let's ping Richard.

@rbberger what are your thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also have some project level env script that gets loaded by the CI and sets those paths

Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New changes for phase names looks good. It does occur to me that there is one slightly more evil way of cleaning this up. DataBox supports arithmetic types, of which char is one. So you could make the phase names a DataBox<char>. Then to treat it as a string, when desired, use DataBox::data. Then you can just register it with the databox names vec and it should (I think?) be serialized, moved to device, etc., all automatically.

That said, your updated handling seems perfectly good to me. Thanks for iterating on it!

Copy link
Collaborator Author

@adamdempsey90 adamdempsey90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is all set on my end. Once #606 passes the tests, we can merge.

@adamdempsey90
Copy link
Collaborator Author

All tests are passing. I think this is ready to go @Yurlungur

@Yurlungur
Copy link
Collaborator

Great! Let's get this in.

@Yurlungur Yurlungur merged commit facbc40 into main Mar 4, 2026
9 checks passed
@Yurlungur Yurlungur deleted the dempsey/mass_frac branch March 4, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants